package Monster;

abstract class BaseAMonster {
  int hp = 100;
  int attack = 0;
  int defenseNumber = 0;
  boolean isAlive = true;

  public void say() {
  };

  public void attach() {
  };

  public int getHp() {
    return hp;
  }

  public int getAttack(int attack) {

    return hp;
  }
};

public class BaseMonster extends BaseAMonster {

  BaseMonster() {
    hp = 100;
    attack = 2;
    defenseNumber = 1;
    isAlive = true;
  }

  @Override
  public int getAttack(int attack) {
    if (hp <= 0) {
      isAlive = false;
      return hp;
    }

    int attactNum = attack <= defenseNumber ? 0 : attack - defenseNumber;

    if (hp <= attactNum) {
      isAlive = false;
      hp = 0;
      return hp;
    }

    hp = hp - attactNum;

    return attactNum;
  }
}